#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File  : dwspark调用.py
# @Author: Richard Chiming Xu
# @Date  : 2025/5/12
# @Desc  :
from dwspark.config import Config
# 加载系统环境变量：SPARKAI_UID、SPARKAI_APP_ID、SPARKAI_API_KEY、SPARKAI_API_SECRET
config = Config()

# SDK引入模型
from dwspark.models import Audio2Text
# 日志
from loguru import logger

# 模拟问题
logger.info('----------开始语音识别----------')
audio2text = Audio2Text(config)
result = audio2text.recognize("./demo.mp3")
logger.info(f'识别结果：{result}')
logger.info('done.')